#pragma once
class Viewer;

#include <Windows.h>
#include <windowsx.h>
#include <windows.devices.input.h>
#include "messageHandler.h"
#include "Drawable.h"
#include "GameMap.h"
#define _USE_MATH_DEFINES
using namespace std;

class Viewer : public MessageHandler, public Drawable
{
public:
	Viewer(void);
	Viewer(int width, int height, int tWidth, int tHeight, GameMap* map);
	void mouseWheelHandler(WPARAM wParam, LPARAM lParam);
	
	void setViewMatrix();
	~Viewer(void);
	virtual LRESULT handle(Window&, UINT, HWND, long, long);
	virtual void draw();
	void tick();

private:
	int pitch, yaw;
	bool aKey, sKey, dKey, wKey;
	int width, height;
	float rotationX, rotationY, rotationZ;
	int mouseX, mouseY;
	struct Eye{
		float X,Y,Z;
		Eye(){X=0;Y=0;Z=0;};
		Eye(float x, float y, float z){
			X = x;
			Y = y;
			Z = z;
		}
	};
	struct LookAt{
		float X,Y,Z;
		
		LookAt(){X=0;Y=0;Z=0;};
		LookAt(float x, float y, float z){
			X = x;
			Y = y;
			Z = z;
		}
	};
	Eye eye;
	LookAt lookAt;
	const static float speed;

	GameMap* g;

};

